package org.fujene.memoryblock.keyvalue;

import org.fujene.memoryblock.BlockPackage;
import org.fujene.structure.LookupPointer;

// invert index package
public final class KeyValuePackage implements BlockPackage{
	private long key;
	private long value;
	private LookupPointer next;

	private KeyValuePackage(){}

	public static KeyValuePackage getPackage(long key, long value, LookupPointer next){
		KeyValuePackage pkg = new KeyValuePackage();
		pkg.key = key;
		pkg.value = value;
		pkg.next = next;

		return pkg;
	}

	public long getKey() {
		return key;
	}
	
	public long getValue() {
		return value;
	}
	
	public LookupPointer getNext(){
		return next;
	}
	
	@Override
	public int length(){
		return LONG * 2;
	}
}